home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / os2 / diskct10.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-01-13  |  2KB  |  89 lines

  1. /* install DiskCat */
  2.  
  3. call RxFuncAdd "SysLoadFuncs","RexxUtil","SysLoadFuncs"
  4. call SysLoadFuncs
  5. call SysCls
  6.  
  7. say
  8. say   "DiskCat install utility"
  9. say
  10. say
  11. say   "please enter target drive/path :"
  12. say   "(default C:\DiskCat)"
  13. pos = SysCurPos(4,34)
  14. pull  laufwerk
  15. pos = SysCurPos(7,0)
  16.  
  17. map = SysDriveMap("A:")
  18. ziellw = "C:\DiskCat\"
  19. dp = ":"
  20. bs = "\"
  21.  
  22. if substr(laufwerk,1,1) = ""
  23.    then  ziel = ziellw
  24.    else  ziel = laufwerk
  25. if substr(ziel,2,1) = ""
  26.    then  ziel = insert(dp,ziel,1)
  27. if substr(ziel,3,1) = ""
  28.    then  ziel = insert(bs,ziel,2)
  29.  
  30. if wordpos(substr(ziel,1,2),map) = 0
  31.    then  do
  32.       say   "drive does not exist!"
  33.       exit
  34.    end
  35.  
  36. if substr(ziel,length(ziel),1) = bs
  37.    then  ziel = delstr(ziel,length(ziel),1)
  38.  
  39. if length(ziel) > 3 then do
  40.  
  41.    rc = SysFileTree(ziel,"ergebnis","D")
  42.    dirfound = 0
  43.  
  44.    if ergebnis.0 = 0 then do
  45.  
  46.       say "directory does not exist, create ? y/n :"
  47.       pos = SysCurPos(7,45)
  48.       pull antwort
  49.  
  50.       if antwort = "Y" then do
  51.          rc = SysMkDir(ziel)
  52.  
  53.          if rc > 0 then do
  54.             say "could not create target directory !!!"
  55.             exit
  56.          end
  57.          else do
  58.             rc = SysFileTree(ziel,"ergebnis","D")
  59.             if ergebnis.0 > 0 then
  60.                dirfound = 1
  61.          end
  62.       end
  63.    end
  64.    else
  65.       dirfound = 1
  66. end
  67.  
  68.  
  69. if dirfound = 1 then do
  70.    "@copy diskcat.exe >NUL" ziel
  71.    "@copy diskcat.msg >NUL" ziel
  72.  
  73.    options = "EXENAME=" || ziel || "DiskCat.EXE;"
  74.    ziel = delstr(ziel,length(ziel),1)
  75.    options = options || "STARTUPDIR=" || ziel || ";"
  76.    rc=SysCreateObject('WPProgram',titel,'<WP_DESKTOP>',options,'u');
  77.  
  78.    drive = substr(ziel,1,2)
  79.    drive
  80.    "@cd "ziel
  81.  
  82.    "start diskcat.exe "ziel
  83. end
  84.  
  85.  
  86. call SysDropFuncs
  87. exit
  88.  
  89.